/*
 * @Description: 
 * @Author: fhw
 * @Date: 2023-03-06 14:50:18
 */
import { ApiProperty } from "@nestjs/swagger";
import { BaseEntity, PaginatedResult } from "src/common/entities/entities";
import { Entity, Column, OneToOne, JoinColumn, ManyToOne } from "typeorm";
import { UserEntity } from "../../user/entities/user.entity";

@Entity('feedback')
export class FeedbackEntity extends BaseEntity {
    /** 反馈内容 */
    @ApiProperty({ example: 'content', description: '反馈内容' })
    @Column({
        type: 'text',
        comment: '反馈内容',
        nullable: true,
    })
    content: string;
     /** 图片 */
     @ApiProperty({ example: 'images', description: '图片' })
     @Column({
         type: 'json',
         comment: '图片',
         nullable: true,
     })
     images: string;
    /** 电话号码 */
    @ApiProperty({ example: 'phone', description: '电话号码' })
    @Column({
        type: 'varchar',
        comment: '电话号码',
        nullable: true,
    })
    phone: string;
    /** 反馈用户 */
    @ApiProperty({ example: 'userId', description: '反馈用户' })
    @Column({ type: 'int', comment: '反馈用户' })
    userId: number;
    /** 用户Id */
    @ManyToOne(() => UserEntity, (user) => user.feedback, {})
    @JoinColumn({ name: 'userId' })
    user: UserEntity;
}
export class FeedbackResult extends PaginatedResult {
    @ApiProperty({ example: 'data', description: 'data' })
    data: FeedbackEntity;
}